class Solution(object):
    def canConstruct(self, ransomNote, magazine):
        """
        :type ransomNote: str
        :type magazine: str
        :rtype: bool
        """
        for c in ransomNote:
            if c in magazine:
                magazine = magazine.replace(c, "", 1)
            else:
                return False
            
        return True

s = Solution()
print(s.canConstruct("aa", "ab"))
print(s.canConstruct("a", "b"))
print(s.canConstruct("aa", "aab"))